package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/12/26
 */
@Entity
@Table(name = "salesman_mapping")
@DynamicInsert
public class SalesmanMappingEntity extends BaseEntity{
    private String salesmanNo;
    private String employeeNo;

    @Basic
    @Column(name = "salesman_no")
    public String getSalesmanNo() {
        return salesmanNo;
    }

    public void setSalesmanNo(String salesmanNo) {
        this.salesmanNo = salesmanNo;
    }

    @Basic
    @Column(name = "employee_no")
    public String getEmployeeNo() {
        return employeeNo;
    }

    public void setEmployeeNo(String employeeNo) {
        this.employeeNo = employeeNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SalesmanMappingEntity that = (SalesmanMappingEntity) o;

        if (salesmanNo != null ? !salesmanNo.equals(that.salesmanNo) : that.salesmanNo != null) return false;
        if (employeeNo != null ? !employeeNo.equals(that.employeeNo) : that.employeeNo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = salesmanNo != null ? salesmanNo.hashCode() : 0;
        result = 31 * result + (employeeNo != null ? employeeNo.hashCode() : 0);
        return result;
    }
}
